package com.ssy.lingxi.message.entity;


import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 会员消息实体类
 * @author yzc
 * @version 2.0.0
 * @date 2020/10/26
 */
@Data
@Entity
@Table(schema = "public", name = "msg_member_message", indexes = {
        @Index(name = "msg_member_message_rec_member_id_idx", columnList = "recMemberId"),
        @Index(name = "msg_member_message_rec_role_id_idx", columnList = "recRoleId"),
        @Index(name = "msg_member_message_rec_user_id_idx", columnList = "recUserId"),
        @Index(name = "msg_member_message_status_idx", columnList = "status"),
        @Index(name = "msg_member_message_type_idx", columnList = "type"),
        @Index(name = "msg_member_message_business_type_idx", columnList = "businessType")
})
public class MemberMessage implements Serializable {

    private static final long serialVersionUID = 5231755892611144497L;

    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "member_message_seq")
    @SequenceGenerator(sequenceName = "msg_member_message_seq", name = "member_message_seq", allocationSize = 1)
    private Long id;

    /**
     * 主消息id
     */
    @Column
    private Long mainMessageId;

    /**
     * 发送人会员id
     */
    @Column
    private Long sendMemberId;

    /**
     * 发送人角色id
     */
    @Column
    private Long sendRoleId;

    /**
     * 接收人会员id
     */
    @Column
    private Long recMemberId;

    /**
     * 接收人角色id
     */
    @Column
    private Long recRoleId;

    /**
     * 接收人用户id
     */
    @Column
    private Long recUserId;

    /**
     * 是否已读 0-否 1-是
     */
    @Column
    private Integer status;

    /**
     * 消息类型 1-系统消息 2-平台消息
     */
    @Column
    private Integer type;

    /**
     * 消息标题
     */
    @Column
    private String title;

    /**
     * 业务类型
     * product-商品, member-会员,
     * dq-需求报价 iq-询价报价,
     * order-订单, capital-资金
     * integral-积分, logistics-物流
     * process-加工生产, after_sale-售后
     */
    @Column
    private String businessType;

    /**
     * 消息内容
     */
    @Column
    private String content;

    /**
     * web跳转地址
     */
    @Column
    private String url;

    /**
     * app跳转地址
     */
    @Column
    private String appUrl;

    /**
     * 是否删除 0-否 1是
     */
    @Column
    private Integer deleted;

    /**
     * 发送时间
     */
    @Column
    private Long sendTime;

    /**
     * 创建时间
     */
    @Column
    private Long createTime;
}
